import os
import time
from tool.ssh_manager import ssh_manager

class TestCase:
    def setup_class(self):
        self.host = "10.108.186.110"
        self.user = "root"
        self.passw = "nokia123"

    def test_exec_command(self):
        rpc = ssh_manager.RemotePc(self.host, self.user, self.passw)
        assert rpc.send_command("whoami").strip() == "root"

    def test_sftp_put(self):
        with open("{}.txt".format(time.time), "w") as tempfile:
            tempfile.write(str(time.time))
            rpc = ssh_manager.RemotePc(self.host, self.user, self.passw)
            rpc.putfile("{}.txt".format(time.time), "/home/soc_ci/temp/test_quinn.txt")
